package com.wjl.picture.post.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wjl.picture.post.model.dto.PostQueryRequest;
import com.wjl.picture.post.model.entity.Post;
import com.wjl.picture.post.model.vo.PostVO;
import com.wjl.picture.user.model.entity.User;

import java.util.List;

/**
 * 帖子服务
 *
 */
public interface PostService extends IService<Post> {

    /**
     * 校验
     *
     * @param post
     * @param add
     */
    void validPost(Post post, boolean add);

    /**
     * 获取查询条件
     *
     * @param postQueryRequest
     * @return
     */
    LambdaQueryWrapper<Post> getLambdaQueryWrapper(PostQueryRequest postQueryRequest);
    /**
     * 获取帖子封装
     *
     * @param post
     * @return
     */
    PostVO getPostVO(Post post);

    /**
     * 分页获取帖子封装
     *
     * @param postPage
     * @return
     */
    Page<PostVO> getPostVOPage(Page<Post> postPage);

    /**
     * 分页查询帖子
     * @param postQueryRequest
     * @return
     */
    Page<PostVO> listPostVOByPage(PostQueryRequest postQueryRequest);

    /**
     * 校验删除请求
     * @param ids
     * @param user
     * @return
     */
    void validDelete( List<Long> ids, User user);
}
